﻿using System;
using System.Collections.Generic;
using System.Text;
using EntityFrameworkCore;
using EntityFrameworkCore.Model;

namespace CucumberJwt.Application.Authorization.Audit.Service
{
    public class AuditService : IAuditService
    {
        private readonly IRepository<AuditLog> _repository = null;
        private readonly IUnitOfWork _unitOfWork = null;

        public AuditService(IRepository<AuditLog> repository, IUnitOfWork unitOfWork)
        {
            _repository = repository;
            _unitOfWork = unitOfWork;
        }

        public void Add(AuditLog auditLogs)
        {
            _unitOfWork.BeginTran();
            _repository.Add(auditLogs);
            _unitOfWork.Commit();
        }
    }
}
